package zjt.calendar;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

public class demo1 {
    public static void main(String[] args) {
        Calendar calendar = Calendar.getInstance();
        //calendar.set(Calendar.YEAR,2021);
        calendar.set(2021,1,12);
        Date date = calendar.getTime();
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        String format = sdf.format(date);
        System.out.println(format);
    }
}
